package org.csu.question.entity.dto;

import lombok.Data;

@Data
public class KnowledgePointStatsDTO {
    private Long knowledgePointId;
    private String name;
    private String tag;
    private Integer totalCount;
    private Integer correctCount;
    private Double correctRate;
    private Integer recentTotalCount; // 最近答题数
    private Integer recentCorrectCount; // 最近答对数
    private Double recentCorrectRate; // 最近正确率
    private Double masteryLevel; // 掌握程度(0-1)
    private String masteryDescription; // 掌握程度描述

    public String getMasteryDescription() {
        if (correctRate == null || totalCount == 0) {
            return "未练习";
        }

        if (correctRate >= 0.9) {
            return "熟练掌握";
        } else if (correctRate >= 0.7) {
            return "基本掌握";
        } else if (correctRate >= 0.5) {
            return "部分掌握";
        } else {
            return "需要加强";
        }
    }
}